import java.io.*;
import java.util.*;

class Student implements Serializable {
	public String firstName, lastName;
	public float gpa;

	public Student(String firstName, String lastName, float gpa) {
		this.firstName = firstName;
		this.lastName = lastName;
		this.gpa = gpa;
	}

	@Override
	public String toString() {
		return this.firstName + " " + this.lastName + " has a gpa of " + this.gpa;
	}
}

public class StudentMap extends HashMap<String, Student> {
	public static void main(String[] args) {
		StudentMap map = new StudentMap();

		map.put("John Doe", new Student("John", "Doe", 3.0f));
		map.put("Jane Doe", new Student("Jane", "Doe", 3.7f));

		try {
			FileOutputStream fos = new FileOutputStream("students.db");
			ObjectOutputStream oos = new ObjectOutputStream(fos);

			oos.writeObject(map);

			oos.close();
			fos.close();
		} catch (Exception ex) {
			System.err.println(ex);
		}
	}
}
